﻿<phone:PhoneApplicationPage xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"  
    x:Class="WeatherCN_Phone.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800" 
    xmlns:Local="clr-namespace:WeatherCN_Phone.Infrastructure"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False"
    xmlns:prism="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation">

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="ListHeader">
            <TextBlock Text="new releases" Style="{StaticResource PhoneTextTitle1Style}"/>
        </DataTemplate>
        <DataTemplate x:Key="GroupHeader">
            <Border Background="{StaticResource PhoneAccentBrush}" Padding="{StaticResource PhoneTouchTargetOverhang}">
                <TextBlock Foreground="Black" Text="{Binding Key}" Style="{StaticResource PhoneTextLargeStyle}"/>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="groupItem">
            <Border Background="{StaticResource PhoneAccentBrush}" Margin="{StaticResource PhoneTouchTargetOverhang}" Padding="{StaticResource PhoneTouchTargetOverhang}">
                <TextBlock Foreground="Black" Text="{Binding Key}" Style="{StaticResource PhoneTextLargeStyle}"/>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="ItemTemplate">
            <Grid Margin="{StaticResource PhoneTouchTargetOverhang}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="130"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="98"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="{Binding CityName}" Style="{StaticResource PhoneTextLargeStyle}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" TextWrapping="Wrap" Margin="12,-12,12,6"/>
                <Button Grid.Column="1" Margin="0,-26,0,0" BorderThickness="0" prism:Click.Command="{Binding  Source={StaticResource ResMainVM},Path=GetSpecificWeatherInfoCommand}" prism:Click.CommandParameter="{Binding CityID}" Click="LongListSelectionChanged" >
                    <Button.Content>
                        <Image Width="48" Source="Assets/icon_view.png"></Image>
                    </Button.Content>
                </Button>
                <Button Grid.Column="2" Margin="0,-26,0,0" BorderThickness="0" prism:Click.Command="{Binding  Source={StaticResource ResMainVM},Path=AddFavCommand}" prism:Click.CommandParameter="{Binding CityID}" >
                    <Button.Content>
                        <Image Width="48" Source="Assets/icon_addfav.png"></Image>
                    </Button.Content>
                </Button>
            </Grid>
        </DataTemplate>

        <Local:WeatherIconConverter x:Key="IconConverter" />
        <Local:DateConverter x:Key="DateConverter" />
        <Local:WeekConverter x:Key="WeekConverter" />
        <Local:ThemeToggleConverter x:Key="ToggleConverter" />
        <Local:ThemeIconSampleConverter x:Key="IconSampleConverter" />
        <Local:ThemeStatusTextConverter x:Key="StatusTextConverter" />
        <Local:ProgressBarVisibilityConverter x:Key="VisibilityConverter" />
        <Local:DayNightVisibilityConverter x:Key="DayNightVisibilityConverter" />
    </phone:PhoneApplicationPage.Resources>
    <Grid x:Name="LayoutRoot" Background="Transparent">

        <!--Panorama control-->
        <controls:Panorama Name="Panorama_Main" SelectionChanged="Panorama_Main_SelectionChanged">
            <controls:Panorama.Title>
                <Image Source="Assets/WeatherCN.png" Margin="-9,70,0,0"/>
            </controls:Panorama.Title>
            <controls:Panorama.Background>
                <ImageBrush ImageSource="Assets/PanoramaBackground.png"/>
            </controls:Panorama.Background>
            <!--Panorama item 天气信息页面 Default Panorama item-->
            <controls:PanoramaItem x:Name="WeatherInfo">
                <controls:PanoramaItem.Header>
                    <StackPanel Orientation="Horizontal" Visibility="{Binding WeatherInfoPanelVisibility}">
                        <TextBlock Foreground="Black" Text="{Binding WeatherInfo.city}" Margin="0,0,10,0" FontSize="48"></TextBlock>
                        <TextBlock Text="{Binding WeatherInfo.date_y}" FontSize="24"></TextBlock>
                        <TextBlock Text="{Binding WeatherInfo.fchh}" FontSize="24"></TextBlock>
                        <TextBlock Text="时发布" FontSize="24"></TextBlock>
                    </StackPanel>
                </controls:PanoramaItem.Header>
                <ScrollViewer Foreground="Black" Visibility="{Binding WeatherInfoPanelVisibility}">
                    <StackPanel>
                        <!--第一天-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock  Text="{Binding WeatherInfo.date_y,Converter={StaticResource DateConverter},ConverterParameter=0}" Margin="0,0,10,0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource WeekConverter},ConverterParameter=0}"></TextBlock>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="24" />
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="128" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="64" />
                                <RowDefinition Height="64" />
                            </Grid.RowDefinitions>

                            <Image Width="64" Grid.Column="0" Grid.Row="0" Source="{Binding WeatherInfo.img_title11,Converter={StaticResource IconConverter}}" ></Image>
                            <Image Width="64" Grid.Column="0" Grid.Row="1" Source="{Binding WeatherInfo.img_title12,Converter={StaticResource IconConverter}}"></Image>

                            <TextBlock Text="白天" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"></TextBlock>
                            <TextBlock Text="夜晚" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBlock>

                            <TextBlock Text="{Binding WeatherInfo.img_title11}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.img_title12}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"></TextBlock>

                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="0">
                                <TextBlock Text="高温：" Visibility="{Binding WeatherInfo.img_title11 ,Converter={StaticResource DayNightVisibilityConverter},ConverterParameter=First}"></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp11}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
                                <TextBlock Text="低温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp12}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding WeatherInfo.wind11}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.wind12}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>

                        </Grid>
                        <!--第二天-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource DateConverter},ConverterParameter=1}" Margin="0,0,10,0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource WeekConverter},ConverterParameter=1}"></TextBlock>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="24" />
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="128" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="64" />
                                <RowDefinition Height="64" />
                            </Grid.RowDefinitions>

                            <Image Width="64" Grid.Column="0" Grid.Row="0" Source="{Binding WeatherInfo.img_title21,Converter={StaticResource IconConverter}}"></Image>
                            <Image Width="64" Grid.Column="0" Grid.Row="1" Source="{Binding WeatherInfo.img_title22,Converter={StaticResource IconConverter}}"></Image>

                            <TextBlock Text="白天" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"></TextBlock>
                            <TextBlock Text="夜晚" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBlock>

                            <TextBlock Text="{Binding WeatherInfo.img_title21}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.img_title22}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"></TextBlock>

                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="0">
                                <TextBlock Text="高温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp21}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
                                <TextBlock Text="低温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp22}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding WeatherInfo.wind21}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.wind22}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>

                        </Grid>
                        <!--第三天-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource DateConverter},ConverterParameter=2}" Margin="0,0,10,0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource WeekConverter},ConverterParameter=2}"></TextBlock>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="24" />
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="128" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="64" />
                                <RowDefinition Height="64" />
                            </Grid.RowDefinitions>

                            <Image Width="64" Grid.Column="0" Grid.Row="0" Source="{Binding WeatherInfo.img_title31,Converter={StaticResource IconConverter}}"></Image>
                            <Image Width="64" Grid.Column="0" Grid.Row="1" Source="{Binding WeatherInfo.img_title32,Converter={StaticResource IconConverter}}"></Image>

                            <TextBlock Text="白天" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"></TextBlock>
                            <TextBlock Text="夜晚" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBlock>

                            <TextBlock Text="{Binding WeatherInfo.img_title31}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.img_title32}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"></TextBlock>

                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="0">
                                <TextBlock Text="高温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp31}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
                                <TextBlock Text="低温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp32}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding WeatherInfo.wind31}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.wind32}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>

                        </Grid>
                        <!--第四天-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource DateConverter},ConverterParameter=3}" Margin="0,0,10,0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource WeekConverter},ConverterParameter=3}"></TextBlock>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="24" />
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="128" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="64" />
                                <RowDefinition Height="64" />
                            </Grid.RowDefinitions>

                            <Image Width="64" Grid.Column="0" Grid.Row="0" Source="{Binding WeatherInfo.img_title41,Converter={StaticResource IconConverter}}"></Image>
                            <Image Width="64" Grid.Column="0" Grid.Row="1" Source="{Binding WeatherInfo.img_title42,Converter={StaticResource IconConverter}}"></Image>

                            <TextBlock Text="白天" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"></TextBlock>
                            <TextBlock Text="夜晚" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBlock>

                            <TextBlock Text="{Binding WeatherInfo.img_title41}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.img_title42}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"></TextBlock>

                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="0">
                                <TextBlock Text="高温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp41}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
                                <TextBlock Text="低温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp42}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding WeatherInfo.wind41}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.wind42}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>

                        </Grid>
                        <!--第五天-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource DateConverter},ConverterParameter=4}" Margin="0,0,10,0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource WeekConverter},ConverterParameter=4}"></TextBlock>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="24" />
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="128" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="64" />
                                <RowDefinition Height="64" />
                            </Grid.RowDefinitions>

                            <Image Width="64" Grid.Column="0" Grid.Row="0" Source="{Binding WeatherInfo.img_title51,Converter={StaticResource IconConverter}}"></Image>
                            <Image Width="64" Grid.Column="0" Grid.Row="1" Source="{Binding WeatherInfo.img_title52,Converter={StaticResource IconConverter}}"></Image>

                            <TextBlock Text="白天" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"></TextBlock>
                            <TextBlock Text="夜晚" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBlock>

                            <TextBlock Text="{Binding WeatherInfo.img_title51}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.img_title52}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"></TextBlock>

                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="0">
                                <TextBlock Text="高温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp51}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
                                <TextBlock Text="低温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp52}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding WeatherInfo.wind51}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.wind52}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>

                        </Grid>
                        <!--第六天-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource DateConverter},ConverterParameter=5}" Margin="0,0,10,0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource WeekConverter},ConverterParameter=5}"></TextBlock>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="24" />
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="128" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="64" />
                                <RowDefinition Height="64" />
                            </Grid.RowDefinitions>

                            <Image Width="64" Grid.Column="0" Grid.Row="0" Source="{Binding WeatherInfo.img_title61,Converter={StaticResource IconConverter}}"></Image>
                            <Image Width="64" Grid.Column="0" Grid.Row="1" Source="{Binding WeatherInfo.img_title62,Converter={StaticResource IconConverter}}"></Image>

                            <TextBlock Text="白天" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"></TextBlock>
                            <TextBlock Text="夜晚" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBlock>

                            <TextBlock Text="{Binding WeatherInfo.img_title61}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.img_title62}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"></TextBlock>

                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="0">
                                <TextBlock Text="高温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp61}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
                                <TextBlock Text="低温："></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp62}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding WeatherInfo.wind61}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.wind62}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>

                        </Grid>
                        <!--第七天-->
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource DateConverter},ConverterParameter=6}" Margin="0,0,10,0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.date_y,Converter={StaticResource WeekConverter},ConverterParameter=6}"></TextBlock>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="24" />
                                <ColumnDefinition Width="64" />
                                <ColumnDefinition Width="128" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="64" />
                                <RowDefinition Height="64" />
                            </Grid.RowDefinitions>

                            <Image Width="64" Grid.Column="0" Grid.Row="0" Source="{Binding WeatherInfo.img_title71,Converter={StaticResource IconConverter}}"></Image>
                            <Image Width="64" Grid.Column="0" Grid.Row="1" Source="{Binding WeatherInfo.img_title72,Converter={StaticResource IconConverter}}"></Image>

                            <TextBlock Text="白天" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"></TextBlock>
                            <TextBlock Text="夜晚" TextWrapping="Wrap" Grid.Column="1" Grid.Row="1"></TextBlock>

                            <TextBlock Text="{Binding WeatherInfo.img_title71}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.img_title72}" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"></TextBlock>

                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="0">
                                <TextBlock Text="高温：" Visibility="{Binding WeatherInfo.img_title11 ,Converter={StaticResource DayNightVisibilityConverter},ConverterParameter=End}"></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp71}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal" Grid.Column="3" Grid.Row="1">
                                <!--中国天气网返回的数据只有6x24h，此处预留-->
                                <TextBlock Text="低温：" Visibility="Collapsed"></TextBlock>
                                <TextBlock Text="{Binding WeatherInfo.temp72}" TextWrapping="Wrap"></TextBlock>
                            </StackPanel>

                            <TextBlock Text="{Binding WeatherInfo.wind71}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="0"></TextBlock>
                            <TextBlock Text="{Binding WeatherInfo.wind72}" TextWrapping="Wrap" Grid.Column="4" Grid.Row="1"></TextBlock>

                        </Grid>
                    </StackPanel>
                </ScrollViewer>
            </controls:PanoramaItem>

            <!--Panorama item 搜藏页面-->
            <controls:PanoramaItem x:Name="Favorite">
                <controls:PanoramaItem.Header>
                    <TextBlock>
                        <Run>Favorite</Run>
                        <LineBreak/>
                        <Run FontSize="24" Foreground="Black">To see the menu you can</Run>
                        <LineBreak/>
                        <Run FontSize="24" Foreground="Black">Press and Hold one square</Run>
                    </TextBlock>
                </controls:PanoramaItem.Header>
                <ItemsControl ItemsSource="{Binding FavoriteItemList}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Border Margin="8" Grid.Row="0" Background="{Binding bgColor}" BorderThickness="2" Width="100" Height="100" BorderBrush="{StaticResource PhoneForegroundBrush}">
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu IsZoomEnabled="False">
                                            <toolkit:MenuItem Header="查看天气" Tag="{Binding CityID}" Click="MenuItem_GetWeatherInfoClick" />
                                            <toolkit:Separator/>
                                            <toolkit:MenuItem Header="取消收藏" Tag="{Binding CityID}" Click="MenuItem_DelFavClick" />
                                            <toolkit:Separator/>                                            
                                            <toolkit:MenuItem Header="更换标识颜色" Tag="{Binding CityID}" Click="MenuItem_ChangeFavColorClick"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </Border>
                                <TextBlock Foreground="Black" Grid.Row="1" Margin="0" Text="{Binding CityName}" HorizontalAlignment="Center"></TextBlock>
                            </Grid>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <toolkit:WrapPanel Orientation="Horizontal"></toolkit:WrapPanel>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.Template>
                        <ControlTemplate>
                            <ScrollViewer>
                                <ItemsPresenter/>
                            </ScrollViewer>
                        </ControlTemplate>
                    </ItemsControl.Template>
                </ItemsControl>
            </controls:PanoramaItem>

            <!--Panorama item 城市或地区列表页面-->
            <controls:PanoramaItem Header="Search" x:Name="Search">
                <toolkit:LongListSelector x:Name="CityLongList" Background="Transparent"
                    GroupHeaderTemplate="{StaticResource GroupHeader}"
                    GroupItemTemplate="{StaticResource groupItem}"
                    ItemTemplate="{StaticResource ItemTemplate}" 
                    ItemsSource="{Binding LongListItems}" 
                    >
                </toolkit:LongListSelector>

            </controls:PanoramaItem>

            <!--Panorama item 主题列表页面-->
            <controls:PanoramaItem Header="Theme" x:Name="Theme">
                <ListBox ItemsSource="{Binding ThemeConfigList}" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="0,0,0,45">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <StackPanel Grid.Row="0" Orientation="Horizontal">
                                    <TextBlock Text="主题名称：" Foreground="Black"></TextBlock>
                                    <TextBlock Text="{Binding ThemeName}" Foreground="Black"></TextBlock>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Grid.Row="1">
                                    <StackPanel>
                                        <Image Width="64" Source="{Binding ThemeName,Converter={StaticResource IconSampleConverter},ConverterParameter=晴}"></Image>
                                        <TextBlock Text="晴" HorizontalAlignment="Center"></TextBlock>
                                    </StackPanel>
                                    <StackPanel>
                                        <Image Width="64" Source="{Binding ThemeName,Converter={StaticResource IconSampleConverter},ConverterParameter=多云}"></Image>
                                        <TextBlock Text="多云" HorizontalAlignment="Center"></TextBlock>
                                    </StackPanel>
                                    <StackPanel>
                                        <Image Width="64" Source="{Binding ThemeName,Converter={StaticResource IconSampleConverter},ConverterParameter=阴}"></Image>
                                        <TextBlock Text="阴" HorizontalAlignment="Center"></TextBlock>
                                    </StackPanel>
                                    <StackPanel>
                                        <Image Width="64" Source="{Binding ThemeName,Converter={StaticResource IconSampleConverter},ConverterParameter=小雨}"></Image>
                                        <TextBlock Text="小雨" HorizontalAlignment="Center"></TextBlock>
                                    </StackPanel>
                                    <StackPanel>
                                        <Image Width="64" Source="{Binding ThemeName,Converter={StaticResource IconSampleConverter},ConverterParameter=雷阵雨}"></Image>
                                        <TextBlock Text="雷阵雨" HorizontalAlignment="Center"></TextBlock>
                                    </StackPanel>
                                </StackPanel>
                                <Grid  Grid.Row="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="250" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Foreground="Black" TextWrapping="Wrap" Margin="0,9,0,0" Name="ThemeStatus" Grid.Column="0" Text="{Binding ThemeName,Converter={StaticResource StatusTextConverter}}"></TextBlock>
                                    <Button Grid.Column="1" HorizontalAlignment="Right" prism:Click.Command="{Binding Source={StaticResource ResMainVM},Path=SetThemeCommand}" prism:Click.CommandParameter="{Binding ThemeName}" BorderThickness="0">
                                        <Button.Content>
                                            <Image Width="100" Source="{Binding ThemeName,Converter={StaticResource ToggleConverter}}" Margin="0" ></Image>
                                        </Button.Content>
                                    </Button>
                                </Grid>
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>

            <!--Panorama item 技术支持信息-->
            <controls:PanoramaItem Header="TechSupport" x:Name="TechSupport">
                <StackPanel HorizontalAlignment="Left">
                    <Image Source="Assets/PIC_HY_HighYouth_317x114.png" Stretch="None" HorizontalAlignment="Left"/>
                    <TextBlock Foreground="Black">
                        <LineBreak/>
                        <LineBreak/>                       
                        <LineBreak/>
                        <LineBreak/>
                        If you have any questions
                        <LineBreak/>
                        Please contact us with the following info:
                        <LineBreak/>
                        <LineBreak/>
                        <LineBreak/>
                        <LineBreak/>
                        Website:Http://HighYouth.com
                        <LineBreak/>
                        Email:Tsui@HighYouth.com
                        <LineBreak/>
                        QQ:781922840
                        <LineBreak/>
                        Add:A2-507，JSSVU，SuZhou，China
                    </TextBlock>
                </StackPanel>
            </controls:PanoramaItem>
        </controls:Panorama>

        <ProgressBar
                x:Name="customIndeterminateProgressBar"
                IsIndeterminate="{Binding IsLoading}"
                Visibility="{Binding IsLoading,Converter={StaticResource VisibilityConverter}}"
                Style="{StaticResource CustomIndeterminateProgressBar}"
                />
    </Grid>

</phone:PhoneApplicationPage>